<template>
  <div>
    <el-table :data="tableData" style="width: 100%" stripe border>
      <el-table-column prop="rid" label="角色编号" width="180" />
      <el-table-column prop="rname" label="角色名称" width="180" />
      <el-table-column prop="rinfo" label="详情" />
      <el-table-column prop="rname" label="建立时间" />
      <el-table-column prop="status" label="状态" />
    </el-table>
  </div>
</template>

<script setup>
// 把axios导入的组件中
import axios from 'axios'
import { ref } from 'vue'

function loadrole() {
  // 为给定 ID 的 user 创建请求
  axios
    .get('http://localhost:8080/sys/r/f/by/null')
    .then(function (response) {
      if (response.status === 200) {
        const data = response.data
        if (data && data.code === 200) {
          console.log(data.result)
          tableData.value = data.result
        }
      }
    })
    .catch(function (error) {
      console.log(error)
    })
}

const tableData = ref([])

loadrole()
</script>
